//
//  ComparisonSortingAlgorithms.swift
//  DataStructure
//
//  Created by kys-20 on 2019/8/27.
//  Copyright © 2019 kys-20. All rights reserved.
//

import Foundation
import UIKit
class ComparisonSortingAlgorithms: NavigationControllerBase {
    
    var comparisonSortingAlgorithmsView:ComparisonSortingAlgorithmsView? = nil
    
    override func viewDidLoad() {
        super.viewDidLoad()
        self.view.backgroundColor = UIColor.white
    }
    
    override func viewWillAppear(_ animated: Bool) {
        let navigationHEIGHT = self.navigationController?.navigationBar.frame.size.height
        let statusHEIGHT = UIApplication.shared.statusBarFrame.size.height
        comparisonSortingAlgorithmsView = ComparisonSortingAlgorithmsView()
        comparisonSortingAlgorithmsView!.frame = CGRect(x: 0, y: navigationHEIGHT!+statusHEIGHT, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height - navigationHEIGHT!+statusHEIGHT)
        self.view.addSubview(comparisonSortingAlgorithmsView!)
    }
    
    override func viewWillDisappear(_ animated: Bool) {
        comparisonSortingAlgorithmsView?.removeFromSuperview()
    }
    
    override func backButtonAction() {
        let kAppdelegate: AppDelegate? = UIApplication.shared.delegate as? AppDelegate
        let rotation : UIInterfaceOrientationMask = [.portrait]
        kAppdelegate?.blockRotation = rotation
        navigationController?.popViewController(animated: false)
    }
}
